package jwf.fcgi;

/**
 * 
 * @author michael
 * @email liyong@renren-inc.com
 * 
 */
public interface FCGXConstants {

    final int FCGIMaxLen = 0xffff;
    /*
     * Define Length of FCGI message bodies in bytes
     */
    final int FCGIHeaderLen = 8;
    final int FCGIEndReqBodyLen = 8;
    final int FCGIBeginReqBodyLen = 8;
    final int FCGIUnknownBodyTypeBodyLen = 8;
    /*
     * Header defines
     */
    int FCGIVersion1 = 1;
    /* FCGI Record Types */
    final int FCGIBeginRequest = 1;
    final int FCGIAbortRequest = 2;
    final int FCGIEndRequest = 3;
    final int FCGIParams = 4;
    final int FCGIStdin = 5;
    final int FCGIStdout = 6;
    final int FCGIStderr = 7;
    final int FCGIData = 8;
    final int FCGIGetValues = 9;
    final int FCGIGetValuesResult = 10;
    final int FCGIUnknownType = 11;
    final int FCGIMaxType = FCGIUnknownType;
    /* Request ID Values */
    final int FCGINullRequestID = 0;
    /*
     * Begin Request defines
     */
    /* Mask flags */
    int FCGIKeepConn = 1;

    /* Roles */
    final int FCGIResponder = 1;
    final int FCGIAuthorizer = 2;
    final int FCGIFilter = 3;
    /*
     * End Request defines
     */
    /* Protocol status */
    final int FCGIRequestComplete = 0;
    final int FCGICantMpxConn = 1;
    final int FCGIOverload = 2;
    final int FCGIUnknownRole = 3;
    /*
     * Get Values, Get Values Results defines
     */
    final String FCGIMaxConns = "FCGI_MAX_CONNS";
    final String FCGIMaxReqs = "FCGI_MAX_REQS";
    final String FCGIMpxsConns = "FCGI_MPXS_CONNS";
    /*
     * Return codes for Process* functions
     */
    final int FCGIStreamRecord = 0;
    final int FCGISkip = 1;
    final int FCGIBeginRecord = 2;
    final int FCGIMgmtRecord = 3;
    /*
     * Error Codes
     */
    final int FCGIUnsupportedVersion = -2;
    final int FCGIProtocolError = -3;
    final int FCGIParamsError = -4;
    final int FCGICallSeqError = -5;

}
